From: Florian Müllner Date: Tue, 20 Aug 2019 21:20:31 +0000 (+0200) Subject: jsParse: Disambiguate regex X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~811^2^2~114 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=9f11fbad1674a376249236faf90b3681feb587d6;p=gnome-shell.git jsParse: Disambiguate regex Make it clear that /= is part of a regex and not an operator shorthand. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/710 --- diff --git a/js/misc/jsParse.js b/js/misc/jsParse.js index 05ab42337..43e99cabc 100644 --- a/js/misc/jsParse.js +++ b/js/misc/jsParse.js @@ -217,7 +217,7 @@ function isUnsafeExpression(str) { prunedStr = prunedStr.replace(/[=!]==/g, ''); //replace === and !== with nothing prunedStr = prunedStr.replace(/[=<>!]=/g, ''); //replace ==, <=, >=, != with nothing - if (prunedStr.match(/=/)) { + if (prunedStr.match(/[=]/)) { return true; } else if (prunedStr.match(/;/)) { // If we contain a semicolon not inside of a quote/regex, assume we're unsafe as well